package com.demo.alibaba.util;

/**
 * Created by yangshunxing on 2016/10/10.
 */
public class IntegerOutLastZero {
    public static void main(String[] args) {
        int a = 510107;
        int b = 510100;
        IntegerOutLastZero i = new IntegerOutLastZero();
        System.out.println(i.outLastZero(a));
        System.out.println(i.outLastZero(b));

        int p = 85;
        System.out.println(p/10);

    }

    public int outLastZero(int number){
        boolean flag = false;
        int dividend = 10;
        while(!flag){
            if(number%dividend != 0){
                flag = true;
            }else {
                dividend = dividend * 10;
            }
        }
        return number/(dividend/10);
    }
}
